import  math
import random
import posixpath as path
print('姓名:袁兆华  学号: 20190751028')
print('作业如下:')
print('1.程序1')
print(math.sqrt(16))
print(math.cos(math.pi / 4))
print(random.choices('abcd', k = 8)) #从字符串abcd随机选择8字符，允许重复
print(path.isfile(r'C:\Windows\notepad.exe'))
print()

print('2.程序2')
from math import pi as PI
from os.path import getsize
from random import choice
r = 3
print(round(PI* r * r, 2))
print(getsize((r'C:\Windows\notepad.exe'))) #计算文件大小
print(choice('Python')) #从字符串随机抽出一个字符
print()

print('3.程序3')
from itertools import *
characters = '1234'
for item in combinations(characters, 3):
    print(item, end=" ")
print('\n'+'='*20)
for item in permutations(characters, 3):
    print(item)